
//
//  AppInfoModel.m
//  zilla-ios-sdk
//
//  Created by Fanty on 13-12-27.
//  Copyright (c) 2013年 Fanty. All rights reserved.
//

#import "Modules.h"


@implementation AppValidate

@end


@implementation CubeModel


- (void)encodeWithCoder:(NSCoder *)aCoder{
    if(self.iconUrl!=nil) [aCoder encodeObject:self.iconUrl forKey:@"iconUrl"];
    [aCoder encodeBool:self.autoDownload forKey:@"autoDownload"];
    [aCoder encodeBool:self.updateable forKey:@"updateable"];
    [aCoder encodeInt32:self.build forKey:@"build"];

    if(self.version!=nil) [aCoder encodeObject:self.version forKey:@"version"];
    if(self.name!=nil) [aCoder encodeObject:self.name forKey:@"name"];
    if(self.releaseNote!=nil) [aCoder encodeObject:self.releaseNote forKey:@"releaseNote"];
    if(self.identifier!=nil) [aCoder encodeObject:self.identifier forKey:@"identifier"];

    if(self.platform!=nil) [aCoder encodeObject:self.platform forKey:@"platform"];

    if(self.moduleUrl!=nil) [aCoder encodeObject:self.moduleUrl forKey:@"moduleUrl"];

    [aCoder encodeInt64:self.downloadedProcess forKey:@"downloadedProcess"];
    [aCoder encodeInt64:self.downloadedTotalCount forKey:@"downloadedTotalCount"];

    [aCoder encodeInt32:self.moduleType forKey:@"status"];
    
    
}

- (id)initWithCoder:(NSCoder *)aDecoder{
    
    self=[self init];
    if(self){
        self.iconUrl=[aDecoder decodeObjectForKey:@"iconUrl"];
        self.name=[aDecoder decodeObjectForKey:@"name"];
        self.autoDownload=[aDecoder decodeBoolForKey:@"autoDownload"];
        self.updateable=[aDecoder decodeBoolForKey:@"updateable"];
        self.build=[aDecoder decodeInt32ForKey:@"build"];

        self.version=[aDecoder decodeObjectForKey:@"version"];
        self.releaseNote=[aDecoder decodeObjectForKey:@"releaseNote"];
        self.identifier=[aDecoder decodeObjectForKey:@"identifier"];
        self.platform=[aDecoder decodeObjectForKey:@"platform"];
        self.moduleUrl=[aDecoder decodeObjectForKey:@"moduleUrl"];

        self.downloadedProcess=(long)[aDecoder decodeInt64ForKey:@"downloadedProcess"];
        self.downloadedTotalCount=(long)[aDecoder decodeInt64ForKey:@"downloadedTotalCount"];
        self.moduleType=[aDecoder decodeInt32ForKey:@"status"];

    }
    return self;
}




@end

@implementation CubeModelList

@end
